"""
对复杂列表进行排序
"""
students = [
    {"sno":101,"sname":"小张","sgrade":88},
    {"sno":102,"sname":"小王","sgrade":99},
    {"sno":103,"sname":"小李","sgrade":66},
    {"sno":104,"sname":"小红","sgrade":77}
]

# 利用sorted函数排序
students_sorted = sorted(students,key=lambda x:x['sgrade'],reverse=True)
print(students)
print(students_sorted)